import request from '@/utils/request'

export function getDeptTree() {
  return request({
    url: '/depts/tree',
    method: 'get'
  })
}



export function getDeptInfoByDeptId(id) {
  return request({
    url: '/depts/'+id,
    method: 'get',
    // params: {id :id }
  })
}

export function saveDeptInfo(data) {
  return request({
    url: '/depts',
    method: 'post',
    data
  })
}

export function upDeptInfo(data) {
  return request({
    url: '/depts',
    method: 'put',
    data
  })
}

export function deleteDept(id) {
  return request({
    url: '/depts/' + id,
    method: 'delete'
  })
}
